<?php

use yii\helpers\Url;
use yii\widgets\Pjax;
$this->inline("title","分类管理");
?>
<div class="panel">
    <div class="panel-body">
        <div class="card-box">
            <?php Pjax::begin(['id' => 'item-data-list']);?>
                <div class="row">
                    <div class="col-lg-6">
                        <div class="card-box">
                            <div class="m-b-30">
                                <a href="<?=Url::toRoute('/category/create')?>" class="btn btn-primary waves-effect waves-light">
                                    添加分类
                                    <i class="fa fa-plus"></i>
                                </a>
                            </div>
                            <p class="text-muted m-b-30 font-13">
                                文章分类管理，月分越品质
                            </p>
                            <table class="tablesaw m-t-20 table m-b-0" data-tablesaw-mode="stack">
                                <thead>
                                    <tr>
                                        <th>分类名称</th>
                                        <th>描述</th>
                                        <th colspan="3">操作</th>
                                    </tr>
                                </thead>
                                <tbody>
                                <?php foreach ($cate as $value):?>
                                    <tr>
                                        <td><?php echo $value['html'].$value['cname']?></td>
                                        <td><?php echo mb_substr($value['desc'],0,25,'utf-8').'...'?></td>
                                        <td><a class="btn btn-primary btn-xs waves-effect waves-light" href="<?=Url::toRoute('/category/create?id='.$value['id'])?>">添加</a></td>
                                        <td><a class="btn btn-primary btn-xs waves-effect waves-light" href="<?=Url::toRoute('/category/update?id='.$value['id'])?>">编辑</a></td>
                                        <td><a data-id="<?php echo $value['id'];?>" onclick="app.deleteData(this,'id');return false;" class="btn btn-primary btn-xs waves-effect waves-light" href="<?=Url::toRoute('/category/delete')?>">删除</a></td>
                                    </tr>
                                <?php endforeach;?>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            <?php Pjax::end();?>
        </div>
    </div>
</div>
<?php $this->beginBlock('jsText','append')?>
<script type="text/javascript">

</script>
<?php $this->endBlock();?>
